A dynamic web-page typically includes one or more static objects and one or more dynamic objects. Serving a web-page thus includes assembling these objects and integrating them to form a web-page.
The static objects are those objects that change rarely, if at all. Examples of such objects include company logos or general instructions and forms for ordering merchandise, biographies of key personnel, and general background about the company serving the web-page.
Dynamic objects are those objects that change frequently. For example, a catalog of merchandise may include notice of special sales that must be updated at regular intervals. Stock prices or news items are often updated on a daily basis. In another example, a web-page can include objects that are uniquely associated with a user requesting the web-page. One common example of such an object can be found in web-pages that greet a repeat customer by name. These components must be updated every time a user requests the web-page.
A modern web-serving system is typically a distributed system in which an origin server is in communication with a plurality of caches. Static components of a web-page are typically stored in the caches, whereas dynamic components of the web-page are generated by the origin server. In such a system, the process of assembling a web-page for serving to a customer involves retrieval of a variety of constituent objects from various locations. A distributed web-serving system of this type is advantageous because it frees the origin server from having to provide static objects.
A disadvantage of the foregoing distributed web-serving system is that although dynamic objects need to be periodically updated, they do not always need to be updated each time a request is made. For example, a dynamic object that lists the daily price of various commodities needs to be updated only once a day. A dynamic object that lists available items needs to be updated when the last unit of a particular item has been sold.
The updating of dynamic objects often involves execution of a database query by the origin server. For example, when a customer wishes to view what items are being offered for a special discount, the origin server may need to formulate a database query that not only asks for a list of what items are on sale but also determines the number of such items available for sale.
To further reduce the load on the origin server, it is preferable that these dynamic objects also be cached and that the cache be updated periodically to avoid the serving of obsolete dynamic components. Where the generation of a dynamic object requires execution of a database query that is expected to be common to many requesting users, it is useful to cache the results of that query to avoid having the origin server needlessly re-execute the same query.
Existing cache management software is not capable of gracefully accommodating the caching of dynamic web-pages. The conventional method of managing a cache of dynamic web-pages is to assign to each dynamic object a date on which that object becomes stale and must be updated. A disadvantage of this method is that it assumes that a stale date, which is to some extent arbitrarily assigned, is a definitive indicator of whether a dynamic object needs to updated. In fact, there may be occasions when a dynamic object becomes obsolete long before its stale date. Conversely, there may occasions when a dynamic object remains current long after the stale date.